import request from '@/utils/request'

// 查询公告列表
export function listNotice(data) {
  return request({
    url: '/system/notice/list',
    method: 'post',
    data,
  })
}

// 查询公告详细
export function getNotice(noticeId) {
  return request({
    url: `/system/notice/${ noticeId }`,
    method: 'get',
  })
}

// 新增公告
export function addNotice(data) {
  return request({
    url: '/system/notice/add',
    method: 'post',
    data,
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded',
    },
  })
}

// 修改公告
export function updateNotice(data) {
  return request({
    url: '/system/notice/edit',
    method: 'post',
    data,
    headers: {
      'Content-Type': 'application/x-www-form-urlencoded',
    },
  })
}

// 删除公告
export function delNotice(noticeId) {
  return request({
    url: '/system/notice/delete',
    method: 'post',
    data: { noticeId },
  })
}
// 删除公告
export function delFile({ id, uid }) {
  return request({
    url: '/system/notice/delFile',
    method: 'post',
    data: {
      id,
      uid,
    },
  })
}
